<template>
  <div>
    <!-- 头部试图 -->
    <XHNavHeader :title="title"></XHNavHeader>

    <!-- {{msg}} -->
    <!-- 一个 cell -->
    <div class="cell-content">
      <XHCell
        @handleClick="cellClick"
        :leftIcon="item.icon"
        :name="item.name"
        v-for="(item, index) in arr"
        :key="index"
      >{{item}}</XHCell>
    </div>
  </div>
</template>


<script>
// 引入要使用的组件
//import Home from '@/components/HelloWorld'
import XHCell from "../Public/XHCell";
import lists from "../../data/mine";
import { Toast } from "mint-ui";
import XHNavHeader from "../Public/XHNavHeader";

console.log("lists=====" + JSON.stringify(lists));

export default {
  name: "xxx",
  data() {
    return {
      // 数据初始化  init
      msg: "你二舅,我的页面",
      arr: lists.data,
      title:"我的"
    };
  },
  methods: {
    // 所有方法在这里实现
    //clickAction(){
    //我是例子
    //}
    cellClick(param) {
      console.log("接受到的值" + param);
      Toast({
        message: param,
        position: "middle",
        duration: 1000
      });
    }
  },
  mounted() {
    //获取 DOM 节点 == viewDidLoad
  },
  props: {
    //给父类传值
  },
  components: {
    XHCell,
    XHNavHeader
  }
};
</script>
<style scoped>
/* 样式处理 */
.cell-content{
  margin-top: 44px;
}
</style>